package com.sskj.mine.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.ToastUtil;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.mine.bean.SpreadBean;
import com.sskj.mine.http.HttpConfig;
import com.sskj.mine.ui.activity.SpreadActivity;


public class SpreadActivityPresenter extends BasePresenter<SpreadActivity> {

    public void getData() {
        httpService.getSpreadData()
                .execute(new JsonCallBack<HttpData<SpreadBean>>() {
                    @Override
                    public void onSuccess(Response<HttpData<SpreadBean>> response) {
                        HttpData<SpreadBean> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {

                            mView.updateUI(httpData.getData());
                        }
                    }
                });
    }
}
